package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.pojo.DtsCategory;
import com.qf.vo.CategorySellAmts;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 类目表 Mapper 接口
 * </p>
 *
 * @author zhaojian
 * @since 2021-05-12
 */
public interface DtsCategoryMapper extends BaseMapper<DtsCategory> {

    @Select("selet dc.name,sum(dog.price*dog.number) as value + \n" +
            "from dts_category dc \n"+
            "inner join dts_goods dg on dc.id=dg.category_id \n" +
            "inner join dts_order_goods dog on dg.id=dog.goods_id\n" +
            "group by dc.name")
    List<CategorySellAmts> categorySell();


}
